package com.bing.domain.service.base.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bing.common.model.PageResult;
import com.bing.common.util.PageUtil;
import com.bing.domain.dao.base.entity.UserRecord;
import com.bing.domain.dao.base.mapper.UserRecordMapper;
import com.bing.domain.model.base.bo.AppUserPage;
import com.bing.domain.service.base.IUserRecordService;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * @Description UserRecordService
 * @Author Bing
 * @Date 2025/8/22 9:11
 */
@Service
public class UserRecordService extends ServiceImpl<UserRecordMapper, UserRecord> implements IUserRecordService {
    @Override
    public List<UserRecord> pageList(AppUserPage req) {
        PageHelper.startPage(req.getPageNum(), req.getPageSize(),Boolean.FALSE);
        return this.list(new LambdaQueryWrapper<>());
    }

    @Override
    public PageResult<UserRecord> page(AppUserPage req) {
        LambdaQueryWrapper<UserRecord> queryWrapper = new LambdaQueryWrapper<>();
        IPage<UserRecord>  page = this.page(PageUtil.toPage( req),queryWrapper);
        return PageResult.success(page);
    }
}